package com.hzxy.yiyid.web.module.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzxy.yiyid.web.module.controller.Dto.MouthDto;
import com.hzxy.yiyid.web.module.repository.entity.Mouth;
import com.hzxy.yiyid.web.module.repository.entity.NourishmentFunction;
import com.hzxy.yiyid.web.module.repository.entity.VegetableFruit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MouthMapper extends BaseMapper<Mouth> {

    @Select("select c.id,c.vegetable_fruit,c.pic,c.create_time,c.update_time,c.function,c.type from mouth as m, mouth_vegefruit as b ,vegetable_fruit as c WHERE m.id = b.mouth_id and b.vege_fruit_id = c.id and m.mouth=#{mouthDto}")
    List<VegetableFruit> selectBymouth(String mouthDto);

    @Select("select * from nourishment_function where id = #{id}")
    NourishmentFunction selectDetatilsById(Integer id);
}
